package com.lanou.controller;

import com.lanou.entity.PsyKnow;
import com.lanou.service.PsyKnowService;
import com.lanou.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName PsyKonwController
 * @Description TODO
 * @Author lizhenjiang
 * @Date 2025年08月13日 19:29
 * @Version 1.0
 */
@RestController
@RequestMapping("PsyKnow")
public class PsyKnowController {
    @Autowired
    private PsyKnowService psyKnowService;

    @GetMapping("{id}")
    public R getPsyKonwById(@PathVariable Integer id) {
        return R.ok(psyKnowService.getPsyKnow(id));
    }

    @GetMapping("getPages")
    public R getPsyKnowList(PsyKnow psyKnow, @RequestParam(value = "pageNum",defaultValue = "1",required = false) Integer pageNum, @RequestParam(value = "pageSize",defaultValue = "10",required = false) Integer pageSize) {
        return R.ok(psyKnowService.getPsyKnows(psyKnow,pageNum,pageSize));
    }
}
